Как упростить работу с аргументами в командной строке с помощью typer
Раньше для CLI-приложений на Python я использовал argparse, потом был click, но недавно полностью перешёл на typer. Это библиотека от автора FastAPI, и она реально 🔥
$ python main.py hello Alice --age 30 Привет, Alice! Тебе 30 лет.
Что круто: - Автоматически генерируется --help - Пишется почти как обычная функция - Есть автокомплит в оболочках (bash/zsh) - Поддержка аннотаций типов и валидации "из коробки"
Если ты всё ещё страдаешь с argparse, рекомендую попробовать typer. Особенно если ты уже кайфуешь от FastAPI — синтаксис и подход очень похожи.
Как упростить работу с аргументами в командной строке с помощью typer
Раньше для CLI-приложений на Python я использовал argparse, потом был click, но недавно полностью перешёл на typer. Это библиотека от автора FastAPI, и она реально 🔥
$ python main.py hello Alice --age 30 Привет, Alice! Тебе 30 лет.
Что круто: - Автоматически генерируется --help - Пишется почти как обычная функция - Есть автокомплит в оболочках (bash/zsh) - Поддержка аннотаций типов и валидации "из коробки"
Если ты всё ещё страдаешь с argparse, рекомендую попробовать typer. Особенно если ты уже кайфуешь от FastAPI — синтаксис и подход очень похожи.
The STAR Market, as is implied by the name, is heavily geared toward smaller innovative tech companies, in particular those engaged in strategically important fields, such as biopharmaceuticals, 5G technology, semiconductors, and new energy. The STAR Market currently has 340 listed securities. The STAR Market is seen as important for China’s high-tech and emerging industries, providing a space for smaller companies to raise capital in China. This is especially significant for technology companies that may be viewed with suspicion on overseas stock exchanges.
Telegram Gives Up On Crypto Blockchain Project
Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”